home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.1B1 / AIncludes / Sound.a < prev    next >
Encoding:
Text File  |  1995-04-18  |  24.6 KB  |  886 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Sound.a
  3. ;
  4. ;    Contains:    Sound Manager Interfaces.
  5. ;
  6. ;    Version:    Technology:    System 7.5
  7. ;                Package:    Universal Interfaces 2.1ß1 in “MPW Prerelease” on ETO #17
  8. ;
  9. ;    Copyright:    © 1984-1995 by Apple Computer, Inc.
  10. ;                All rights reserved.
  11. ;
  12. ;    Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13. ;                stack.  Include the file and version information (from above)
  14. ;                in the problem description and send to:
  15. ;                    Internet:    apple.bugs@applelink.apple.com
  16. ;                    AppleLink:    APPLE.BUGS
  17. ;
  18. ;
  19.  
  20.     IF &TYPE('__SOUND__') = 'UNDEFINED' THEN
  21. __SOUND__ SET 1
  22.  
  23.  
  24.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  25.     include 'Types.a'
  26.     ENDIF
  27. ;        include 'ConditionalMacros.a'                                ;
  28.  
  29.     IF &TYPE('__MIXEDMODE__') = 'UNDEFINED' THEN
  30.     include 'MixedMode.a'
  31.     ENDIF
  32. ;
  33. ;Interface for Sound Driver, !!! OBSOLETE and NOT SUPPORTED !!!
  34. ;
  35. ;These items are no longer defined, but appear here so that someone
  36. ;searching the interfaces might find them. If you are using one of these
  37. ;items, you must change your code to support the Sound Manager.
  38. ;
  39. ;    swMode, ftMode, ffMode
  40. ;    FreeWave, FFSynthRec, Tone, SWSynthRec, Wave, FTSoundRec
  41. ;    SndCompletionProcPtr
  42. ;    StartSound, StopSound, SoundDone
  43. ;
  44.  
  45. soundListRsrc                    EQU        'snd '                ;Resource type used by Sound Manager
  46. rate44khz                        EQU        $AC440000            ;44100.00000 in fixed-point
  47. rate22050hz                        EQU        $56220000            ;22050.00000 in fixed-point
  48. rate22khz                        EQU        $56EE8BA3            ;22254.54545 in fixed-point
  49. rate11khz                        EQU        $2B7745D1            ;11127.27273 in fixed-point
  50. rate11025hz                        EQU        $2B110000            ;11025.00000 in fixed-point
  51. ;synthesizer numbers for SndNewChannel
  52. squareWaveSynth                    EQU        1                    ;square wave synthesizer
  53. waveTableSynth                    EQU        3                    ;wave table synthesizer
  54. sampledSynth                    EQU        5                    ;sampled sound synthesizer
  55. ;old Sound Manager MACE synthesizer numbers
  56. MACE3snthID                        EQU        11
  57. MACE6snthID                        EQU        13
  58. kMiddleC                        EQU        60                    ;MIDI note value for middle C
  59. kSimpleBeepID                    EQU        1                    ;reserved resource ID for Simple Beep
  60. kFullVolume                        EQU        $0100                ;1.0, setting for full hardware output volume
  61. kNoVolume                        EQU        0                    ;setting for no sound volume
  62. ;command numbers for SndDoCommand and SndDoImmediate
  63. nullCmd                            EQU        0
  64. initCmd                            EQU        1
  65. freeCmd                            EQU        2
  66. quietCmd                        EQU        3
  67. flushCmd                        EQU        4
  68. reInitCmd                        EQU        5
  69. waitCmd                            EQU        10
  70. pauseCmd                        EQU        11
  71. resumeCmd                        EQU        12
  72. callBackCmd                        EQU        13
  73.  
  74. syncCmd                            EQU        14
  75. availableCmd                    EQU        24
  76. versionCmd                        EQU        25
  77. totalLoadCmd                    EQU        26
  78. loadCmd                            EQU        27
  79. freqDurationCmd                    EQU        40
  80. restCmd                            EQU        41
  81. freqCmd                            EQU        42
  82. ampCmd                            EQU        43
  83. timbreCmd                        EQU        44
  84. getAmpCmd                        EQU        45
  85. volumeCmd                        EQU        46                    ;sound manager 3.0 or later only
  86. getVolumeCmd                    EQU        47                    ;sound manager 3.0 or later only
  87. waveTableCmd                    EQU        60
  88. phaseCmd                        EQU        61
  89.  
  90. soundCmd                        EQU        80
  91. bufferCmd                        EQU        81
  92. rateCmd                            EQU        82
  93. continueCmd                        EQU        83
  94. doubleBufferCmd                    EQU        84
  95. getRateCmd                        EQU        85
  96. rateMultiplierCmd                EQU        86
  97. getRateMultiplierCmd            EQU        87
  98. sizeCmd                            EQU        90
  99. convertCmd                        EQU        91
  100. stdQLength                        EQU        128
  101. dataOffsetFlag                    EQU        $8000
  102.  
  103. ;channel initialization parameters
  104.     IF OLDROUTINENAMES  THEN
  105. waveInitChannelMask                EQU        $07
  106. waveInitChannel0                EQU        $04                    ;wave table only, Sound Manager 2.0 and earlier
  107. waveInitChannel1                EQU        $05                    ;wave table only, Sound Manager 2.0 and earlier
  108. waveInitChannel2                EQU        $06                    ;wave table only, Sound Manager 2.0 and earlier
  109. waveInitChannel3                EQU        $07                    ;wave table only, Sound Manager 2.0 and earlier
  110. initChan0                        EQU        waveInitChannel0    ;obsolete spelling
  111. initChan1                        EQU        waveInitChannel1    ;obsolete spelling
  112. initChan2                        EQU        waveInitChannel2    ;obsolete spelling
  113. initChan3                        EQU        waveInitChannel3    ;obsolete spelling
  114.  
  115.     ENDIF
  116. initChanLeft                    EQU        $0002                ;left stereo channel
  117. initChanRight                    EQU        $0003                ;right stereo channel
  118. initNoInterp                    EQU        $0004                ;no linear interpolation
  119. initNoDrop                        EQU        $0008                ;no drop-sample conversion
  120. initMono                        EQU        $0080                ;monophonic channel
  121. initStereo                        EQU        $00C0                ;stereo channel
  122. initMACE3                        EQU        $0300                ;MACE 3:1
  123. initMACE6                        EQU        $0400                ;MACE 6:1
  124. initPanMask                        EQU        $0003                ;mask for right/left pan values
  125. initSRateMask                    EQU        $0030                ;mask for sample rate values
  126. initStereoMask                    EQU        $00C0                ;mask for mono/stereo values
  127. initCompMask                    EQU        $FF00                ;mask for compression IDs
  128. kUseOptionalOutputDevice        EQU        -1                    ;only for Sound Manager 3.0 or later
  129. notCompressed                    EQU        0                    ;compression ID's
  130. fixedCompression                EQU        -1                    ;compression ID for fixed-sized compression
  131. variableCompression                EQU        -2                    ;compression ID for variable-sized compression
  132. twoToOne                        EQU        1
  133. eightToThree                    EQU        2
  134. threeToOne                        EQU        3
  135. sixToOne                        EQU        4
  136.  
  137.     IF ¬ GENERATINGPOWERPC  THEN
  138. stdSH                            EQU        $00                    ;Standard sound header encode value
  139. extSH                            EQU        $FF                    ;Extended sound header encode value
  140. cmpSH                            EQU        $FE                    ;Compressed sound header encode value
  141.  
  142.     ENDIF
  143. outsideCmpSH                    EQU        0                    ;MACE constants
  144. insideCmpSH                        EQU        1
  145. aceSuccess                        EQU        0
  146. aceMemFull                        EQU        1
  147. aceNilBlock                        EQU        2
  148. aceBadComp                        EQU        3
  149. aceBadEncode                    EQU        4
  150. aceBadDest                        EQU        5
  151. aceBadCmd                        EQU        6
  152. sixToOnePacketSize                EQU        8
  153. threeToOnePacketSize            EQU        16
  154. stateBlockSize                    EQU        64
  155. leftOverBlockSize                EQU        32
  156. firstSoundFormat                EQU        $0001                ;general sound format
  157. secondSoundFormat                EQU        $0002                ;special sampled sound format (HyperCard)
  158. dbBufferReady                    EQU        $00000001            ;double buffer is filled
  159. dbLastBuffer                    EQU        $00000004            ;last double buffer to play
  160. sysBeepDisable                    EQU        $0000                ;SysBeep() enable flags
  161. sysBeepEnable                    EQU        $0001
  162. unitTypeNoSelection                EQU        $FFFF                ;unitTypes for AudioSelection.unitType
  163. unitTypeSeconds                    EQU        $0000
  164.  
  165. ; unsigned fixed-point number 
  166. ; typedef unsigned long     UnsignedFixed
  167. SndCommand                 RECORD    0
  168. cmd                         ds.w   1        ; offset: $0 (0)
  169. param1                     ds.w   1        ; offset: $2 (2)
  170. param2                     ds.l   1        ; offset: $4 (4)
  171. sizeof                     EQU *            ; size:   $8 (8)
  172.                         ENDR
  173.  
  174. ; typedef struct SndCommand  SndCommand
  175. ; typedef struct SndChannel  SndChannel
  176. ; typedef SndChannel         *SndChannelPtr
  177. SndChannel                 RECORD    0
  178. nextChan                 ds.l   1        ; offset: $0 (0)
  179. firstMod                 ds.l   1        ; offset: $4 (4)        ; reserved for the Sound Manager 
  180. callBack                 ds.l   1        ; offset: $8 (8)
  181. userInfo                 ds.l   1        ; offset: $C (12)
  182. wait                     ds.l   1        ; offset: $10 (16)        ; The following is for internal Sound Manager use only.
  183. cmdInProgress             ds     SndCommand ; offset: $14 (20)
  184. flags                     ds.w   1        ; offset: $1C (28)
  185. qLength                     ds.w   1        ; offset: $1E (30)
  186. qHead                     ds.w   1        ; offset: $20 (32)
  187. qTail                     ds.w   1        ; offset: $22 (34)
  188. queue                     ds.b   128 * SndCommand.sizeof ; offset: $24 (36)
  189. sizeof                     EQU *            ; size:   $424 (1060)
  190.                         ENDR
  191.  
  192. ;MACE structures
  193. StateBlock                 RECORD    0
  194. stateVar                 ds.w   64        ; offset: $0 (0)
  195. sizeof                     EQU *            ; size:   $80 (128)
  196.                         ENDR
  197.  
  198. ; typedef struct StateBlock  StateBlock
  199. ; typedef StateBlock         *StateBlockPtr
  200. LeftOverBlock             RECORD    0
  201. count                     ds.l   1        ; offset: $0 (0)
  202. sampleArea                 ds.b   32        ; offset: $4 (4)
  203. sizeof                     EQU *            ; size:   $24 (36)
  204.                         ENDR
  205.  
  206. ; typedef struct LeftOverBlock  LeftOverBlock
  207. ; typedef LeftOverBlock     *LeftOverBlockPtr
  208. ModRef                     RECORD    0
  209. modNumber                 ds.w   1        ; offset: $0 (0)
  210. modInit                     ds.l   1        ; offset: $2 (2)
  211. sizeof                     EQU *            ; size:   $6 (6)
  212.                         ENDR
  213.  
  214. ; typedef struct ModRef     ModRef
  215. SndListResource         RECORD    0
  216. format                     ds.w   1        ; offset: $0 (0)
  217. numModifiers             ds.w   1        ; offset: $2 (2)
  218. modifierPart             ds     ModRef    ; offset: $4 (4)        ;This is a variable length array
  219. numCommands                 ds.w   1        ; offset: $A (10)
  220. commandPart                 ds     SndCommand ; offset: $C (12)    ;This is a variable length array
  221. dataPart                 ds.b   1        ; offset: $14 (20)        ;This is a variable length array
  222.                          ORG 22
  223. sizeof                     EQU *            ; size:   $16 (22)
  224.                         ENDR
  225.  
  226. ; typedef struct SndListResource  SndListResource
  227. ; typedef SndListResource     *SndListPtr
  228. ; typedef SndListPtr         *SndListHndl, *SndListHandle
  229. ;HyperCard sound resource format
  230. Snd2ListResource         RECORD    0
  231. format                     ds.w   1        ; offset: $0 (0)
  232. refCount                 ds.w   1        ; offset: $2 (2)
  233. numCommands                 ds.w   1        ; offset: $4 (4)
  234. commandPart                 ds     SndCommand ; offset: $6 (6)        ;This is a variable length array
  235. dataPart                 ds.b   1        ; offset: $E (14)        ;This is a variable length array
  236.                          ORG 16
  237. sizeof                     EQU *            ; size:   $10 (16)
  238.                         ENDR
  239.  
  240. ; typedef struct Snd2ListResource  Snd2ListResource
  241. ; typedef Snd2ListResource     *Snd2ListPtr
  242. ; typedef Snd2ListPtr         *Snd2ListHndl, *Snd2ListHandle
  243. SoundHeader             RECORD    0
  244. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if NIL then samples are in sampleArea
  245. length                     ds.l   1        ; offset: $4 (4)        ;length of sound in bytes
  246. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate for this sound
  247. loopStart                 ds.l   1        ; offset: $C (12)        ;start of looping portion
  248. loopEnd                     ds.l   1        ; offset: $10 (16)        ;end of looping portion
  249. encode                     ds.b   1        ; offset: $14 (20)        ;header encoding
  250. baseFrequency             ds.b   1        ; offset: $15 (21)        ;baseFrequency value
  251. sampleArea                 ds.b   1        ; offset: $16 (22)        ;space for when samples follow directly
  252.                          ORG 24
  253. sizeof                     EQU *            ; size:   $18 (24)
  254.                         ENDR
  255.  
  256. ; typedef struct SoundHeader  SoundHeader
  257. ; typedef SoundHeader         *SoundHeaderPtr
  258. CmpSoundHeader             RECORD    0
  259. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if nil then samples are in sample area
  260. numChannels                 ds.l   1        ; offset: $4 (4)        ;number of channels i.e. mono = 1
  261. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate in Apples Fixed point representation
  262. loopStart                 ds.l   1        ; offset: $C (12)        ;loopStart of sound before compression
  263. loopEnd                     ds.l   1        ; offset: $10 (16)        ;loopEnd of sound before compression
  264. encode                     ds.b   1        ; offset: $14 (20)        ;data structure used , stdSH, extSH, or cmpSH
  265. baseFrequency             ds.b   1        ; offset: $15 (21)        ;same meaning as regular SoundHeader
  266. numFrames                 ds.l   1        ; offset: $16 (22)        ;length in frames ( packetFrames or sampleFrames )
  267. AIFFSampleRate             ds.w   5        ; offset: $1A (26)        ;IEEE sample rate
  268. markerChunk                 ds.l   1        ; offset: $24 (36)        ;sync track
  269. format                     ds.l   1        ; offset: $28 (40)        ;data format type, was futureUse1
  270. futureUse2                 ds.l   1        ; offset: $2C (44)        ;reserved by Apple
  271. stateVars                 ds.l   1        ; offset: $30 (48)        ;pointer to State Block
  272. leftOverSamples             ds.l   1        ; offset: $34 (52)        ;used to save truncated samples between compression calls
  273. compressionID             ds.w   1        ; offset: $38 (56)        ;0 means no compression, non zero means compressionID
  274. packetSize                 ds.w   1        ; offset: $3A (58)        ;number of bits in compressed sample packet
  275. snthID                     ds.w   1        ; offset: $3C (60)        ;resource ID of Sound Manager snth that contains NRT C/E
  276. sampleSize                 ds.w   1        ; offset: $3E (62)        ;number of bits in non-compressed sample
  277. sampleArea                 ds.b   1        ; offset: $40 (64)        ;space for when samples follow directly
  278.                          ORG 66
  279. sizeof                     EQU *            ; size:   $42 (66)
  280.                         ENDR
  281.  
  282. ; typedef struct CmpSoundHeader  CmpSoundHeader
  283. ; typedef CmpSoundHeader     *CmpSoundHeaderPtr
  284. ExtSoundHeader             RECORD    0
  285. samplePtr                 ds.l   1        ; offset: $0 (0)        ;if nil then samples are in sample area
  286. numChannels                 ds.l   1        ; offset: $4 (4)        ;number of channels,  ie mono = 1
  287. sampleRate                 ds.l   1        ; offset: $8 (8)        ;sample rate in Apples Fixed point representation
  288. loopStart                 ds.l   1        ; offset: $C (12)        ;same meaning as regular SoundHeader
  289. loopEnd                     ds.l   1        ; offset: $10 (16)        ;same meaning as regular SoundHeader
  290. encode                     ds.b   1        ; offset: $14 (20)        ;data structure used , stdSH, extSH, or cmpSH
  291. baseFrequency             ds.b   1        ; offset: $15 (21)        ;same meaning as regular SoundHeader
  292. numFrames                 ds.l   1        ; offset: $16 (22)        ;length in total number of frames
  293. AIFFSampleRate             ds.w   5        ; offset: $1A (26)        ;IEEE sample rate
  294. markerChunk                 ds.l   1        ; offset: $24 (36)        ;sync track
  295. instrumentChunks         ds.l   1        ; offset: $28 (40)        ;AIFF instrument chunks
  296. AESRecording             ds.l   1        ; offset: $2C (44)
  297. sampleSize                 ds.w   1        ; offset: $30 (48)        ;number of bits in sample
  298. futureUse1                 ds.w   1        ; offset: $32 (50)        ;reserved by Apple
  299. futureUse2                 ds.l   1        ; offset: $34 (52)        ;reserved by Apple
  300. futureUse3                 ds.l   1        ; offset: $38 (56)        ;reserved by Apple
  301. futureUse4                 ds.l   1        ; offset: $3C (60)        ;reserved by Apple
  302. sampleArea                 ds.b   1        ; offset: $40 (64)        ;space for when samples follow directly
  303.                          ORG 66
  304. sizeof                     EQU *            ; size:   $42 (66)
  305.                         ENDR
  306.  
  307. ; typedef struct ExtSoundHeader  ExtSoundHeader
  308. ; typedef ExtSoundHeader     *ExtSoundHeaderPtr
  309. ConversionBlock         RECORD    0
  310. destination                 ds.w   1        ; offset: $0 (0)
  311. unused                     ds.w   1        ; offset: $2 (2)
  312. inputPtr                 ds.l   1        ; offset: $4 (4)
  313. outputPtr                 ds.l   1        ; offset: $8 (8)
  314. sizeof                     EQU *            ; size:   $C (12)
  315.                         ENDR
  316.  
  317. ; typedef struct ConversionBlock  ConversionBlock
  318. ; typedef ConversionBlock     *ConversionBlockPtr
  319. SMStatus                 RECORD    0
  320. smMaxCPULoad             ds.w   1        ; offset: $0 (0)
  321. smNumChannels             ds.w   1        ; offset: $2 (2)
  322. smCurCPULoad             ds.w   1        ; offset: $4 (4)
  323. sizeof                     EQU *            ; size:   $6 (6)
  324.                         ENDR
  325.  
  326. ; typedef struct SMStatus     SMStatus
  327. ; typedef SMStatus             *SMStatusPtr
  328. SCStatus                 RECORD    0
  329. scStartTime                 ds.l   1        ; offset: $0 (0)
  330. scEndTime                 ds.l   1        ; offset: $4 (4)
  331. scCurrentTime             ds.l   1        ; offset: $8 (8)
  332. scChannelBusy             ds.b   1        ; offset: $C (12)
  333. scChannelDisposed         ds.b   1        ; offset: $D (13)
  334. scChannelPaused             ds.b   1        ; offset: $E (14)
  335. scUnused                 ds.b   1        ; offset: $F (15)
  336. scChannelAttributes         ds.l   1        ; offset: $10 (16)
  337. scCPULoad                 ds.l   1        ; offset: $14 (20)
  338. sizeof                     EQU *            ; size:   $18 (24)
  339.                         ENDR
  340.  
  341. ; typedef struct SCStatus     SCStatus
  342. ; typedef SCStatus             *SCStatusPtr
  343. AudioSelection             RECORD    0
  344. unitType                 ds.l   1        ; offset: $0 (0)
  345. selStart                 ds.l   1        ; offset: $4 (4)
  346. selEnd                     ds.l   1        ; offset: $8 (8)
  347. sizeof                     EQU *            ; size:   $C (12)
  348.                         ENDR
  349.  
  350. ; typedef struct AudioSelection  AudioSelection
  351. ; typedef AudioSelection     *AudioSelectionPtr
  352. SndDoubleBuffer         RECORD    0
  353. dbNumFrames                 ds.l   1        ; offset: $0 (0)
  354. dbFlags                     ds.l   1        ; offset: $4 (4)
  355. dbUserInfo                 ds.l   2        ; offset: $8 (8)
  356. dbSoundData                 ds.b   1        ; offset: $10 (16)
  357.                          ORG 18
  358. sizeof                     EQU *            ; size:   $12 (18)
  359.                         ENDR
  360.  
  361. ; typedef struct SndDoubleBuffer  SndDoubleBuffer
  362. ; typedef SndDoubleBuffer     *SndDoubleBufferPtr
  363. SndDoubleBufferHeader     RECORD    0
  364. dbhNumChannels             ds.w   1        ; offset: $0 (0)
  365. dbhSampleSize             ds.w   1        ; offset: $2 (2)
  366. dbhCompressionID         ds.w   1        ; offset: $4 (4)
  367. dbhPacketSize             ds.w   1        ; offset: $6 (6)
  368. dbhSampleRate             ds.l   1        ; offset: $8 (8)
  369. dbhBufferPtr             ds.l   2        ; offset: $C (12)
  370. dbhDoubleBack             ds.l   1        ; offset: $14 (20)
  371. sizeof                     EQU *            ; size:   $18 (24)
  372.                         ENDR
  373.  
  374. ; typedef struct SndDoubleBufferHeader  SndDoubleBufferHeader
  375. ; typedef SndDoubleBufferHeader  *SndDoubleBufferHeaderPtr
  376. SndDoubleBufferHeader2     RECORD    0
  377. dbhNumChannels             ds.w   1        ; offset: $0 (0)
  378. dbhSampleSize             ds.w   1        ; offset: $2 (2)
  379. dbhCompressionID         ds.w   1        ; offset: $4 (4)
  380. dbhPacketSize             ds.w   1        ; offset: $6 (6)
  381. dbhSampleRate             ds.l   1        ; offset: $8 (8)
  382. dbhBufferPtr             ds.l   2        ; offset: $C (12)
  383. dbhDoubleBack             ds.l   1        ; offset: $14 (20)
  384. dbhFormat                 ds.l   1        ; offset: $18 (24)
  385. sizeof                     EQU *            ; size:   $1C (28)
  386.                         ENDR
  387.  
  388. ; typedef struct SndDoubleBufferHeader2  SndDoubleBufferHeader2
  389. ; typedef SndDoubleBufferHeader2  *SndDoubleBufferHeader2Ptr
  390. SoundInfoList             RECORD    0
  391. count                     ds.w   1        ; offset: $0 (0)
  392. infoHandle                 ds.l   1        ; offset: $2 (2)
  393. sizeof                     EQU *            ; size:   $6 (6)
  394.                         ENDR
  395.  
  396. ; typedef struct SoundInfoList  SoundInfoList
  397. ; typedef SoundInfoList     *SoundInfoListPtr
  398. CompressionInfo         RECORD    0
  399. recordSize                 ds.l   1        ; offset: $0 (0)
  400. format                     ds.l   1        ; offset: $4 (4)
  401. compressionID             ds.w   1        ; offset: $8 (8)
  402. samplesPerPacket         ds.w   1        ; offset: $A (10)
  403. bytesPerPacket             ds.w   1        ; offset: $C (12)
  404. bytesPerFrame             ds.w   1        ; offset: $E (14)
  405. bytesPerSample             ds.w   1        ; offset: $10 (16)
  406. futureUse1                 ds.w   1        ; offset: $12 (18)
  407. sizeof                     EQU *            ; size:   $14 (20)
  408.                         ENDR
  409.  
  410. ; typedef struct CompressionInfo  CompressionInfo
  411. ; typedef CompressionInfo     *CompressionInfoPtr
  412. ; typedef CompressionInfoPtr  *CompressionInfoHandle
  413. ; These two routines for Get/SetSoundVol should no longer be used.
  414. ; They were for old Apple Sound Chip machines, and do not support the DSP or PowerMacs.
  415. ; Use Get/SetDefaultOutputVolume instead, if you must change the user's machine.
  416.     IF OLDROUTINENAMES  ** ¬ GENERATINGCFM  THEN
  417. ;
  418. ; pascal void SetSoundVol(short level)
  419. ;
  420.     IF GENERATINGCFM THEN
  421.         IMPORT_CFM_FUNCTION    SetSoundVol
  422.     ENDIF
  423.  
  424. ;
  425. ; pascal void GetSoundVol(short *level)
  426. ;
  427.     IF ¬ GENERATINGCFM THEN
  428.         ; parameters: 
  429.         ;     level             => A0
  430.         Macro
  431.         _GetSoundVol
  432.             dc.w     $4218
  433.             dc.w     $10B8
  434.             dc.w     $0260
  435.         EndM
  436.     ELSE
  437.         IMPORT_CFM_FUNCTION    GetSoundVol
  438.     ENDIF
  439.  
  440.     ENDIF
  441. ;
  442. ; pascal OSErr SndDoCommand(SndChannelPtr chan, const SndCommand *cmd, Boolean noWait)
  443. ;
  444.     IF ¬ GENERATINGCFM THEN
  445.         _SndDoCommand:    OPWORD    $A803
  446.     ELSE
  447.         IMPORT_CFM_FUNCTION    SndDoCommand
  448.     ENDIF
  449.  
  450. ;
  451. ; pascal OSErr SndDoImmediate(SndChannelPtr chan, const SndCommand *cmd)
  452. ;
  453.     IF ¬ GENERATINGCFM THEN
  454.         _SndDoImmediate:    OPWORD    $A804
  455.     ELSE
  456.         IMPORT_CFM_FUNCTION    SndDoImmediate
  457.     ENDIF
  458.  
  459. ;
  460. ; pascal OSErr SndNewChannel(SndChannelPtr *chan, short synth, long init, SndCallBackUPP userRoutine)
  461. ;
  462.     IF ¬ GENERATINGCFM THEN
  463.         _SndNewChannel:    OPWORD    $A807
  464.     ELSE
  465.         IMPORT_CFM_FUNCTION    SndNewChannel
  466.     ENDIF
  467.  
  468. ;
  469. ; pascal OSErr SndDisposeChannel(SndChannelPtr chan, Boolean quietNow)
  470. ;
  471.     IF ¬ GENERATINGCFM THEN
  472.         _SndDisposeChannel:    OPWORD    $A801
  473.     ELSE
  474.         IMPORT_CFM_FUNCTION    SndDisposeChannel
  475.     ENDIF
  476.  
  477. ;
  478. ; pascal OSErr SndPlay(SndChannelPtr chan, SndListHandle sndHdl, Boolean async)
  479. ;
  480.     IF ¬ GENERATINGCFM THEN
  481.         _SndPlay:    OPWORD    $A805
  482.     ELSE
  483.         IMPORT_CFM_FUNCTION    SndPlay
  484.     ENDIF
  485.  
  486.     IF OLDROUTINENAMES  THEN
  487. ;
  488. ; pascal OSErr SndAddModifier(SndChannelPtr chan, Ptr modifier, short id, long init)
  489. ;
  490.     IF ¬ GENERATINGCFM THEN
  491.         _SndAddModifier:    OPWORD    $A802
  492.     ELSE
  493.         IMPORT_CFM_FUNCTION    SndAddModifier
  494.     ENDIF
  495.  
  496.     ENDIF
  497. ;
  498. ; pascal OSErr SndControl(short id, SndCommand *cmd)
  499. ;
  500.     IF ¬ GENERATINGCFM THEN
  501.         _SndControl:    OPWORD    $A806
  502.     ELSE
  503.         IMPORT_CFM_FUNCTION    SndControl
  504.     ENDIF
  505.  
  506. ; Sound Manager 2.0 and later, uses _SoundDispatch 
  507. ;
  508. ; pascal NumVersion SndSoundManagerVersion(void)
  509. ;
  510.     IF ¬ GENERATINGCFM THEN
  511.         Macro
  512.         _SndSoundManagerVersion
  513.             dc.w     $203C
  514.             dc.w     $000C
  515.             dc.w     $0008
  516.             dc.w     $A800
  517.         EndM
  518.     ELSE
  519.         IMPORT_CFM_FUNCTION    SndSoundManagerVersion
  520.     ENDIF
  521.  
  522. ;
  523. ; pascal OSErr SndStartFilePlay(SndChannelPtr chan, short fRefNum, short resNum, long bufferSize, void *theBuffer, AudioSelectionPtr theSelection, FilePlayCompletionUPP theCompletion, Boolean async)
  524. ;
  525.     IF ¬ GENERATINGCFM THEN
  526.         Macro
  527.         _SndStartFilePlay
  528.             dc.w     $203C
  529.             dc.w     $0D00
  530.             dc.w     $0008
  531.             dc.w     $A800
  532.         EndM
  533.     ELSE
  534.         IMPORT_CFM_FUNCTION    SndStartFilePlay
  535.     ENDIF
  536.  
  537. ;
  538. ; pascal OSErr SndPauseFilePlay(SndChannelPtr chan)
  539. ;
  540.     IF ¬ GENERATINGCFM THEN
  541.         Macro
  542.         _SndPauseFilePlay
  543.             dc.w     $203C
  544.             dc.w     $0204
  545.             dc.w     $0008
  546.             dc.w     $A800
  547.         EndM
  548.     ELSE
  549.         IMPORT_CFM_FUNCTION    SndPauseFilePlay
  550.     ENDIF
  551.  
  552. ;
  553. ; pascal OSErr SndStopFilePlay(SndChannelPtr chan, Boolean quietNow)
  554. ;
  555.     IF ¬ GENERATINGCFM THEN
  556.         Macro
  557.         _SndStopFilePlay
  558.             dc.w     $203C
  559.             dc.w     $0308
  560.             dc.w     $0008
  561.             dc.w     $A800
  562.         EndM
  563.     ELSE
  564.         IMPORT_CFM_FUNCTION    SndStopFilePlay
  565.     ENDIF
  566.  
  567. ;
  568. ; pascal OSErr SndChannelStatus(SndChannelPtr chan, short theLength, SCStatusPtr theStatus)
  569. ;
  570.     IF ¬ GENERATINGCFM THEN
  571.         Macro
  572.         _SndChannelStatus
  573.             dc.w     $203C
  574.             dc.w     $0510
  575.             dc.w     $0008
  576.             dc.w     $A800
  577.         EndM
  578.     ELSE
  579.         IMPORT_CFM_FUNCTION    SndChannelStatus
  580.     ENDIF
  581.  
  582. ;
  583. ; pascal OSErr SndManagerStatus(short theLength, SMStatusPtr theStatus)
  584. ;
  585.     IF ¬ GENERATINGCFM THEN
  586.         Macro
  587.         _SndManagerStatus
  588.             dc.w     $203C
  589.             dc.w     $0314
  590.             dc.w     $0008
  591.             dc.w     $A800
  592.         EndM
  593.     ELSE
  594.         IMPORT_CFM_FUNCTION    SndManagerStatus
  595.     ENDIF
  596.  
  597. ;
  598. ; pascal void SndGetSysBeepState(short *sysBeepState)
  599. ;
  600.     IF ¬ GENERATINGCFM THEN
  601.         Macro
  602.         _SndGetSysBeepState
  603.             dc.w     $203C
  604.             dc.w     $0218
  605.             dc.w     $0008
  606.             dc.w     $A800
  607.         EndM
  608.     ELSE
  609.         IMPORT_CFM_FUNCTION    SndGetSysBeepState
  610.     ENDIF
  611.  
  612. ;
  613. ; pascal OSErr SndSetSysBeepState(short sysBeepState)
  614. ;
  615.     IF ¬ GENERATINGCFM THEN
  616.         Macro
  617.         _SndSetSysBeepState
  618.             dc.w     $203C
  619.             dc.w     $011C
  620.             dc.w     $0008
  621.             dc.w     $A800
  622.         EndM
  623.     ELSE
  624.         IMPORT_CFM_FUNCTION    SndSetSysBeepState
  625.     ENDIF
  626.  
  627. ;
  628. ; pascal OSErr SndPlayDoubleBuffer(SndChannelPtr chan, SndDoubleBufferHeaderPtr theParams)
  629. ;
  630.     IF ¬ GENERATINGCFM THEN
  631.         Macro
  632.         _SndPlayDoubleBuffer
  633.             dc.w     $203C
  634.             dc.w     $0420
  635.             dc.w     $0008
  636.             dc.w     $A800
  637.         EndM
  638.     ELSE
  639.         IMPORT_CFM_FUNCTION    SndPlayDoubleBuffer
  640.     ENDIF
  641.  
  642. ; MACE compression routines 
  643. ;
  644. ; pascal NumVersion MACEVersion(void)
  645. ;
  646.     IF ¬ GENERATINGCFM THEN
  647.         Macro
  648.         _MACEVersion
  649.             dc.w     $203C
  650.             dc.w     $0000
  651.             dc.w     $0010
  652.             dc.w     $A800
  653.         EndM
  654.     ELSE
  655.         IMPORT_CFM_FUNCTION    MACEVersion
  656.     ENDIF
  657.  
  658. ;
  659. ; pascal void Comp3to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  660. ;
  661.     IF ¬ GENERATINGCFM THEN
  662.         Macro
  663.         _Comp3to1
  664.             dc.w     $203C
  665.             dc.w     $0004
  666.             dc.w     $0010
  667.             dc.w     $A800
  668.         EndM
  669.     ELSE
  670.         IMPORT_CFM_FUNCTION    Comp3to1
  671.     ENDIF
  672.  
  673. ;
  674. ; pascal void Exp1to3(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  675. ;
  676.     IF ¬ GENERATINGCFM THEN
  677.         Macro
  678.         _Exp1to3
  679.             dc.w     $203C
  680.             dc.w     $0008
  681.             dc.w     $0010
  682.             dc.w     $A800
  683.         EndM
  684.     ELSE
  685.         IMPORT_CFM_FUNCTION    Exp1to3
  686.     ENDIF
  687.  
  688. ;
  689. ; pascal void Comp6to1(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  690. ;
  691.     IF ¬ GENERATINGCFM THEN
  692.         Macro
  693.         _Comp6to1
  694.             dc.w     $203C
  695.             dc.w     $000C
  696.             dc.w     $0010
  697.             dc.w     $A800
  698.         EndM
  699.     ELSE
  700.         IMPORT_CFM_FUNCTION    Comp6to1
  701.     ENDIF
  702.  
  703. ;
  704. ; pascal void Exp1to6(const void *inBuffer, void *outBuffer, unsigned long cnt, StateBlockPtr inState, StateBlockPtr outState, unsigned long numChannels, unsigned long whichChannel)
  705. ;
  706.     IF ¬ GENERATINGCFM THEN
  707.         Macro
  708.         _Exp1to6
  709.             dc.w     $203C
  710.             dc.w     $0010
  711.             dc.w     $0010
  712.             dc.w     $A800
  713.         EndM
  714.     ELSE
  715.         IMPORT_CFM_FUNCTION    Exp1to6
  716.     ENDIF
  717.  
  718. ; Sound Manager 3.0 and later calls 
  719. ;
  720. ; pascal OSErr GetSysBeepVolume(long *level)
  721. ;
  722.     IF ¬ GENERATINGCFM THEN
  723.         Macro
  724.         _GetSysBeepVolume
  725.             dc.w     $203C
  726.             dc.w     $0224
  727.             dc.w     $0018
  728.             dc.w     $A800
  729.         EndM
  730.     ELSE
  731.         IMPORT_CFM_FUNCTION    GetSysBeepVolume
  732.     ENDIF
  733.  
  734. ;
  735. ; pascal OSErr SetSysBeepVolume(long level)
  736. ;
  737.     IF ¬ GENERATINGCFM THEN
  738.         Macro
  739.         _SetSysBeepVolume
  740.             dc.w     $203C
  741.             dc.w     $0228
  742.             dc.w     $0018
  743.             dc.w     $A800
  744.         EndM
  745.     ELSE
  746.         IMPORT_CFM_FUNCTION    SetSysBeepVolume
  747.     ENDIF
  748.  
  749. ;
  750. ; pascal OSErr GetDefaultOutputVolume(long *level)
  751. ;
  752.     IF ¬ GENERATINGCFM THEN
  753.         Macro
  754.         _GetDefaultOutputVolume
  755.             dc.w     $203C
  756.             dc.w     $022C
  757.             dc.w     $0018
  758.             dc.w     $A800
  759.         EndM
  760.     ELSE
  761.         IMPORT_CFM_FUNCTION    GetDefaultOutputVolume
  762.     ENDIF
  763.  
  764. ;
  765. ; pascal OSErr SetDefaultOutputVolume(long level)
  766. ;
  767.     IF ¬ GENERATINGCFM THEN
  768.         Macro
  769.         _SetDefaultOutputVolume
  770.             dc.w     $203C
  771.             dc.w     $0230
  772.             dc.w     $0018
  773.             dc.w     $A800
  774.         EndM
  775.     ELSE
  776.         IMPORT_CFM_FUNCTION    SetDefaultOutputVolume
  777.     ENDIF
  778.  
  779. ;
  780. ; pascal OSErr GetSoundHeaderOffset(SndListHandle sndHandle, long *offset)
  781. ;
  782.     IF ¬ GENERATINGCFM THEN
  783.         Macro
  784.         _GetSoundHeaderOffset
  785.             dc.w     $203C
  786.             dc.w     $0404
  787.             dc.w     $0018
  788.             dc.w     $A800
  789.         EndM
  790.     ELSE
  791.         IMPORT_CFM_FUNCTION    GetSoundHeaderOffset
  792.     ENDIF
  793.  
  794. ;
  795. ; pascal UnsignedFixed UnsignedFixedMulDiv(UnsignedFixed value, UnsignedFixed multiplier, UnsignedFixed divisor)
  796. ;
  797.     IF ¬ GENERATINGCFM THEN
  798.         Macro
  799.         _UnsignedFixedMulDiv
  800.             dc.w     $203C
  801.             dc.w     $060C
  802.             dc.w     $0018
  803.             dc.w     $A800
  804.         EndM
  805.     ELSE
  806.         IMPORT_CFM_FUNCTION    UnsignedFixedMulDiv
  807.     ENDIF
  808.  
  809. ;
  810. ; pascal OSErr GetCompressionInfo(short compressionID, OSType format, short numChannels, short sampleSize, CompressionInfoPtr cp)
  811. ;
  812.     IF ¬ GENERATINGCFM THEN
  813.         Macro
  814.         _GetCompressionInfo
  815.             dc.w     $203C
  816.             dc.w     $0710
  817.             dc.w     $0018
  818.             dc.w     $A800
  819.         EndM
  820.     ELSE
  821.         IMPORT_CFM_FUNCTION    GetCompressionInfo
  822.     ENDIF
  823.  
  824. ;
  825. ; pascal OSErr SetSoundPreference(OSType theType, Str255 name, Handle settings)
  826. ;
  827.     IF ¬ GENERATINGCFM THEN
  828.         Macro
  829.         _SetSoundPreference
  830.             dc.w     $203C
  831.             dc.w     $0634
  832.             dc.w     $0018
  833.             dc.w     $A800
  834.         EndM
  835.     ELSE
  836.         IMPORT_CFM_FUNCTION    SetSoundPreference
  837.     ENDIF
  838.  
  839. ;
  840. ; pascal OSErr GetSoundPreference(OSType theType, Str255 name, Handle settings)
  841. ;
  842.     IF ¬ GENERATINGCFM THEN
  843.         Macro
  844.         _GetSoundPreference
  845.             dc.w     $203C
  846.             dc.w     $0638
  847.             dc.w     $0018
  848.             dc.w     $A800
  849.         EndM
  850.     ELSE
  851.         IMPORT_CFM_FUNCTION    GetSoundPreference
  852.     ENDIF
  853.  
  854. ; Sound Manager 3.1 and later calls 
  855. ;
  856. ; pascal OSErr SndGetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  857. ;
  858.     IF ¬ GENERATINGCFM THEN
  859.         Macro
  860.         _SndGetInfo
  861.             dc.w     $203C
  862.             dc.w     $063C
  863.             dc.w     $0018
  864.             dc.w     $A800
  865.         EndM
  866.     ELSE
  867.         IMPORT_CFM_FUNCTION    SndGetInfo
  868.     ENDIF
  869.  
  870. ;
  871. ; pascal OSErr SndSetInfo(SndChannelPtr chan, OSType selector, void *infoPtr)
  872. ;
  873.     IF ¬ GENERATINGCFM THEN
  874.         Macro
  875.         _SndSetInfo
  876.             dc.w     $203C
  877.             dc.w     $0640
  878.             dc.w     $0018
  879.             dc.w     $A800
  880.         EndM
  881.     ELSE
  882.         IMPORT_CFM_FUNCTION    SndSetInfo
  883.     ENDIF
  884.  
  885.     ENDIF ; __SOUND__
  886.